package com.dnjn.mes.biz.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dnjn.mes.common.core.domain.BaseEntity;

import java.io.Serializable;
import java.time.LocalTime;
import java.util.List;

import com.dnjn.mes.common.core.domain.entity.SysUser;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 班次
 * </p>
 *
 * @author Amber
 * @since 2023-08-21
 */
@Getter
@Setter
@TableName("mes_workforce_config")
public class MesWorkforceConfig extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * PK
     */
    @TableId(value = "workforce_id", type = IdType.ASSIGN_ID)
    private Long workforceId;

    private Long equipmentId;

    @NotBlank(message = "班次名称不能为空")
    private String workforceName;

    @JsonFormat(pattern = "HH:mm",timezone = "GMT+8")
    @NotNull(message = "开始时间不能为空")
    private LocalTime startTime;

    @JsonFormat(pattern = "HH:mm",timezone = "GMT+8")
    @NotNull(message = "结束时间不能为空")
    private LocalTime endTime;

    /**
     * 是否删除|0-否 1-是|valid
     */
    private String deleted;

    //每个班次总产能
    @TableField(exist = false)
    private Integer totalCapacity;

    //每个班次的产能列表
    @TableField(exist = false)
    private List<MesRecordCapacity> recordCapacityList;

    //每个班次的节拍列表
    @TableField(exist = false)
    private List<MesRecordBeat> recordBeatList;

    @TableField(exist = false)
    private List<MesWorkforceXref> workforceXrefList;
}
